package com.cipe.cmrs.datasource;

import java.sql.DriverManager;
import java.sql.SQLException;

import org.apache.commons.dbcp.BasicDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CustomDataSource extends BasicDataSource {
    private Logger log = LoggerFactory.getLogger(getClass());
    
    public synchronized void close() throws SQLException {
        System.out.println("Closing datasource: " + url);
        log.debug("Closing datasource: " + url);
        DriverManager.deregisterDriver(DriverManager.getDriver(url));
        super.close();
    }
}
